//
//  UIView+ViewController.swift
//  weibo
//
//  Created by 谭仁川 on 15/12/4.
//  Copyright © 2015年 itcast. All rights reserved.
//

import UIKit

extension UIView {

    func navController() -> UINavigationController? {
        var next = nextResponder()
        repeat {
            if let nextobj = next as? UINavigationController{
        
                return nextobj
        
        
        }
        next = next?.nextResponder()

        }while(next != nil)
    
        return nil
    }
    
    
}
